package org.iris.plugin.command

import net.mamoe.mirai.console.command.SimpleCommand
import net.mamoe.mirai.console.command.UserCommandSender
import net.mamoe.mirai.console.command.descriptor.ExperimentalCommandDescriptors
import net.mamoe.mirai.console.util.ConsoleExperimentalApi
import net.mamoe.mirai.contact.User
import org.iris.plugin.HitHit
import org.iris.plugin.data.HitHitData

@ConsoleExperimentalApi
@ExperimentalCommandDescriptors
object AddAlias : SimpleCommand(
    HitHit, "alias",
    description = "设置别名"
) {
    @Handler
    suspend fun UserCommandSender.handle(alias : String, user : User) {
        HitHitData.alias["${subject.id}_${alias}"] = user.id
        subject.sendMessage("设置成功喵")
    }
}